This language is an experiment in making a highly portable functional language. The syntax shown below only illustrates the features of the language, it is only one of many possible projections to view a program. Creating programs is not done by editing text files instead a structured editor is needed.
The language has both a compiler and interpreter, either or even both can be used in one program. Anonymous functions can be captured, serialised and sent to other computers. For example a client and server app can be written as one function.
_ -> {
let html = vacant
request -> client -> {
let method = request.method
let handle_click = perform Alert(method)
html.button("click")(handle_click)
}
}A fully exhaustive type checker exists for the language. i.e. if the checks pass it is guaranteed not to crash. This can be optionally run, it's not worth type checking a build script you get the same error anyway. It's possible to type check a single function.
Because the type system is complete and structural no type ever needs to be declared up front and no annotation is required, in fact annotation is not supported in the language. This choice is to make programmers never need to think about types. Type annotations are possible in the editor but they are only a debug tool and not committed to the source.
The type system contains extensible records and unions as well as an algebraic effect system. These three components are all built on row types, using the same approach for each keeps the implementation simple.
All of the goals of the language are achieved by having the Abstract Syntax Tree (AST) of the language be the public interface and keeping that interface as small as possible. There are currently only 19 different node types that make up the AST.
let std = {json: {parse: {
let catch = exec -> handle Abort(reason -> _kont -> Error(reason))(_ -> Ok(exec({})))
let read_tokens = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let is_whitespace = {
let list = [" "]
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let read_tokens = TODO this shouldn't really be here({
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let is_whitespace = {
let list = [" "]
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let switches = [{key: """, value: {
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let read_string = TODO this shouldn't really be here({
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
read_string -> acc -> buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
})
let done = value -> buffer -> {value: value, buffer: buffer}
let acc = ""
buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
}}, {key: "t", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("r")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(True({}))(parts.tail)
}
}}, {key: "f", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("a")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("s")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(False({}))(parts.tail)
}
}}, {key: "n", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
done(Null({}))(parts.tail)
}
}}, {key: "{", value: {
let value = LeftBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "}", value: {
let value = RightBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "[", value: {
let value = LeftBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: "]", value: {
let value = RightBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: ":", value: {
let value = Colon({})
buffer -> {value: value, buffer: buffer}
}}, {key: ",", value: {
let value = Comma({})
buffer -> {value: value, buffer: buffer}
}}]
read_tokens -> acc -> buffer -> match {
Ok parts -> {
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> read_tokens(acc)(buffer)
False _ -> {
let switch = expect(std.keylist.find(switches)(grapheme))(IllegalCharachter(grapheme))
let value = switch(buffer)
let acc = [value.value, ..acc]
read_tokens(acc)(value.buffer)
}
}(is_whitespace(grapheme))
}
Error _ -> std.list.reverse(acc)
}(std.string.pop_grapheme(buffer))
})
let switches = [{key: """, value: {
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let read_string = TODO this shouldn't really be here({
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
read_string -> acc -> buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
})
let done = value -> buffer -> {value: value, buffer: buffer}
let acc = ""
buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
}}, {key: "t", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("r")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(True({}))(parts.tail)
}
}}, {key: "f", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("a")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("s")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(False({}))(parts.tail)
}
}}, {key: "n", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
done(Null({}))(parts.tail)
}
}}, {key: "{", value: {
let value = LeftBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "}", value: {
let value = RightBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "[", value: {
let value = LeftBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: "]", value: {
let value = RightBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: ":", value: {
let value = Colon({})
buffer -> {value: value, buffer: buffer}
}}, {key: ",", value: {
let value = Comma({})
buffer -> {value: value, buffer: buffer}
}}]
let acc = []
buffer -> match {
Ok parts -> {
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> read_tokens(acc)(buffer)
False _ -> {
let switch = expect(std.keylist.find(switches)(grapheme))(IllegalCharachter(grapheme))
let value = switch(buffer)
let acc = [value.value, ..acc]
read_tokens(acc)(value.buffer)
}
}(is_whitespace(grapheme))
}
Error _ -> std.list.reverse(acc)
}(std.string.pop_grapheme(buffer))
}
decoder -> input -> catch(_ -> decoder(read_tokens(input)).value)
}, boolean: {
let abort = perform Abort
let next_token = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
tokens -> expect(std.list.pop(tokens))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
tokens -> {
let parts = next_token(tokens)
let token = parts.head
let tokens = parts.tail
match {
True _ -> done(True({}))(tokens)
False _ -> done(False({}))(tokens)
_ -> abort(UnexpectedToken(token))
}(token)
}
}, string: {
let abort = perform Abort
let next_token = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
tokens -> expect(std.list.pop(tokens))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
tokens -> {
let parts = next_token(tokens)
let token = parts.head
match {
String value -> done(value)(parts.tail)
_ -> abort(UnexpectedToken(token))
}(token)
}
}, list: {
let abort = perform Abort
let next_token = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
tokens -> expect(std.list.pop(tokens))(UnexpectedEndOfInput({}))
}
let is = match -> match(value -> value)(other -> perform Abort(UnexpectedToken(other)))
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
decoder -> tokens -> {
let parts = next_token(tokens)
let _ = is(match LeftBracket)(parts.head)
let tokens = parts.tail
let parts = std.fix(read_elements -> acc -> tokens -> {
let parts = next_token(tokens)
let token = parts.head
match {
RightBracket _ -> done(acc)(parts.tail)
_ -> {
let decoded = decoder(tokens)
let acc = [decoded.value, ..acc]
let parts = next_token(decoded.buffer)
let token = parts.head
let tokens = parts.tail
match {
Comma _ -> read_elements(acc)(tokens)
RightBracket _ -> done(std.list.reverse(acc))(tokens)
_ -> abort(UnexpectedToken(token))
}(parts.head)
}
}(token)
})([])(tokens)
parts
}
}, field: {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
key -> decoder -> next -> build -> bag -> {
let parts = expect(std.keylist.pop(bag)(key))(MissingField(key))
let bag = parts.rest
let _ = "expected decoded to have nothing in buffer"
let decoded = decoder(parts.value)
let build = build(decoded.value)
next(build)(bag)
}
}, end: t -> _fields -> t, object: {
let next_item = {
let next_item = TODO this shouldn't really be here({
let next_token = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
tokens -> expect(std.list.pop(tokens))(UnexpectedEndOfInput({}))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
let switches = [{key: LeftBracket({}), value: stack -> [LeftBracket({}), ..stack]}, {key: LeftBrace({}), value: stack -> [LeftBrace({}), ..stack]}, {key: RightBracket({}), value: {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let abort = perform Abort
stack -> {
let popped = expect(std.list.pop(stack))(UnexpectedTerminator({}))
match {
True _ -> popped.tail
False _ -> abort(UnexpectedTerminator({}))
}(std.equal(LeftBracket({}))(popped.head))
}
}}, {key: RightBrace({}), value: {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let abort = perform Abort
stack -> {
let popped = expect(std.list.pop(stack))(UnexpectedTerminator({}))
match {
True _ -> popped.tail
False _ -> abort(UnexpectedTerminator({}))
}(std.equal(LeftBrace({}))(popped.head))
}
}}]
next_item -> acc -> stack -> tokens -> {
let start = next_token(tokens)
let acc = [start.head, ..acc]
let stack = match {
Ok update -> update(stack)
Error _ -> stack
}(std.keylist.find(switches)(start.head))
match {
True _ -> done(std.list.reverse(acc))(start.tail)
False _ -> next_item(acc)(stack)(start.tail)
}(std.equal([])(stack))
}
})
let next_token = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
tokens -> expect(std.list.pop(tokens))(UnexpectedEndOfInput({}))
}
let stack = []
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
let switches = [{key: LeftBracket({}), value: stack -> [LeftBracket({}), ..stack]}, {key: LeftBrace({}), value: stack -> [LeftBrace({}), ..stack]}, {key: RightBracket({}), value: {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let abort = perform Abort
stack -> {
let popped = expect(std.list.pop(stack))(UnexpectedTerminator({}))
match {
True _ -> popped.tail
False _ -> abort(UnexpectedTerminator({}))
}(std.equal(LeftBracket({}))(popped.head))
}
}}, {key: RightBrace({}), value: {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let abort = perform Abort
stack -> {
let popped = expect(std.list.pop(stack))(UnexpectedTerminator({}))
match {
True _ -> popped.tail
False _ -> abort(UnexpectedTerminator({}))
}(std.equal(LeftBrace({}))(popped.head))
}
}}]
let acc = []
tokens -> {
let start = next_token(tokens)
let acc = [start.head, ..acc]
let stack = match {
Ok update -> update(stack)
Error _ -> stack
}(std.keylist.find(switches)(start.head))
match {
True _ -> done(std.list.reverse(acc))(start.tail)
False _ -> next_item(acc)(stack)(start.tail)
}(std.equal([])(stack))
}
}
let abort = perform Abort
let next_token = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
tokens -> expect(std.list.pop(tokens))(UnexpectedEndOfInput({}))
}
let is = match -> match(value -> value)(other -> perform Abort(UnexpectedToken(other)))
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
builder -> tokens -> {
let parts = next_token(tokens)
let _ = is(match LeftBrace)(parts.head)
let tokens = parts.tail
let parts = std.fix(read_field -> acc -> tokens -> {
let parts = next_token(tokens)
let token = parts.head
let tokens = parts.tail
match {
String key -> {
let parts = next_token(tokens)
let _ = is(match Colon)(parts.head)
let tokens = parts.tail
let consumed = next_item(parts.tail)
let acc = [{key: key, value: consumed.value}, ..acc]
let parts = next_token(consumed.buffer)
let token = parts.head
let tokens = parts.tail
match {
Comma _ -> read_field(acc)(tokens)
RightBrace _ -> done(acc)(tokens)
_ -> abort(UnexpectedToken(token))
}(parts.head)
}
RightBrace _ -> done(acc)(tokens)
_ -> abort(UnexpectedToken(token))
}(token)
})([])(tokens)
let fields = parts.value
let value = builder(fields)
done(value)(parts.buffer)
}
}, tests: [{exec: {
let should = {equal: {
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
expected -> given -> match {
True _ -> {}
False _ -> {
let failure = NotEqual({given: given, expected: expected})
perform Fail(failure)
}
}(std.equal(expected)(given))
}, be: {
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
match -> match(value -> value)(other -> perform Abort(std.string.append("incorrect variant: ")(std.debug(other))))
}, to_string: match {
NotEqual {
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
fail -> std.string.concat(["expected: ", std.debug(fail.expected), " given: ", std.debug(fail.given)])
}
}}
let read_tokens = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let is_whitespace = {
let list = [" "]
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let read_tokens = TODO this shouldn't really be here({
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let is_whitespace = {
let list = [" "]
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let switches = [{key: """, value: {
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let read_string = TODO this shouldn't really be here({
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
read_string -> acc -> buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
})
let done = value -> buffer -> {value: value, buffer: buffer}
let acc = ""
buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
}}, {key: "t", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("r")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(True({}))(parts.tail)
}
}}, {key: "f", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("a")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("s")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(False({}))(parts.tail)
}
}}, {key: "n", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
done(Null({}))(parts.tail)
}
}}, {key: "{", value: {
let value = LeftBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "}", value: {
let value = RightBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "[", value: {
let value = LeftBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: "]", value: {
let value = RightBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: ":", value: {
let value = Colon({})
buffer -> {value: value, buffer: buffer}
}}, {key: ",", value: {
let value = Comma({})
buffer -> {value: value, buffer: buffer}
}}]
read_tokens -> acc -> buffer -> match {
Ok parts -> {
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> read_tokens(acc)(buffer)
False _ -> {
let switch = expect(std.keylist.find(switches)(grapheme))(IllegalCharachter(grapheme))
let value = switch(buffer)
let acc = [value.value, ..acc]
read_tokens(acc)(value.buffer)
}
}(is_whitespace(grapheme))
}
Error _ -> std.list.reverse(acc)
}(std.string.pop_grapheme(buffer))
})
let switches = [{key: """, value: {
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let read_string = TODO this shouldn't really be here({
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
read_string -> acc -> buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
})
let done = value -> buffer -> {value: value, buffer: buffer}
let acc = ""
buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
}}, {key: "t", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("r")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(True({}))(parts.tail)
}
}}, {key: "f", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("a")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("s")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(False({}))(parts.tail)
}
}}, {key: "n", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
done(Null({}))(parts.tail)
}
}}, {key: "{", value: {
let value = LeftBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "}", value: {
let value = RightBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "[", value: {
let value = LeftBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: "]", value: {
let value = RightBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: ":", value: {
let value = Colon({})
buffer -> {value: value, buffer: buffer}
}}, {key: ",", value: {
let value = Comma({})
buffer -> {value: value, buffer: buffer}
}}]
let acc = []
buffer -> match {
Ok parts -> {
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> read_tokens(acc)(buffer)
False _ -> {
let switch = expect(std.keylist.find(switches)(grapheme))(IllegalCharachter(grapheme))
let value = switch(buffer)
let acc = [value.value, ..acc]
read_tokens(acc)(value.buffer)
}
}(is_whitespace(grapheme))
}
Error _ -> std.list.reverse(acc)
}(std.string.pop_grapheme(buffer))
}
_ -> {
let _ = should.equal([LeftBrace({})])(read_tokens(" {"))
let _ = should.equal([True({})])(read_tokens("true"))
let _ = should.equal([False({})])(read_tokens("false"))
let _ = should.equal([Null({})])(read_tokens("null"))
let _ = should.equal([String("")])(read_tokens(""""))
let _ = should.equal([String("a b c")])(read_tokens(""a b c""))
{}
}
}, name: "pop token"}, {exec: {
let list = {
let abort = perform Abort
let next_token = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
tokens -> expect(std.list.pop(tokens))(UnexpectedEndOfInput({}))
}
let is = match -> match(value -> value)(other -> perform Abort(UnexpectedToken(other)))
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
decoder -> tokens -> {
let parts = next_token(tokens)
let _ = is(match LeftBracket)(parts.head)
let tokens = parts.tail
let parts = std.fix(read_elements -> acc -> tokens -> {
let parts = next_token(tokens)
let token = parts.head
match {
RightBracket _ -> done(acc)(parts.tail)
_ -> {
let decoded = decoder(tokens)
let acc = [decoded.value, ..acc]
let parts = next_token(decoded.buffer)
let token = parts.head
let tokens = parts.tail
match {
Comma _ -> read_elements(acc)(tokens)
RightBracket _ -> done(std.list.reverse(acc))(tokens)
_ -> abort(UnexpectedToken(token))
}(parts.head)
}
}(token)
})([])(tokens)
parts
}
}
let parse = {
let catch = exec -> handle Abort(reason -> _kont -> Error(reason))(_ -> Ok(exec({})))
let read_tokens = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let is_whitespace = {
let list = [" "]
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let read_tokens = TODO this shouldn't really be here({
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let is_whitespace = {
let list = [" "]
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let switches = [{key: """, value: {
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let read_string = TODO this shouldn't really be here({
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
read_string -> acc -> buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
})
let done = value -> buffer -> {value: value, buffer: buffer}
let acc = ""
buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
}}, {key: "t", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("r")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(True({}))(parts.tail)
}
}}, {key: "f", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("a")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("s")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(False({}))(parts.tail)
}
}}, {key: "n", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
done(Null({}))(parts.tail)
}
}}, {key: "{", value: {
let value = LeftBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "}", value: {
let value = RightBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "[", value: {
let value = LeftBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: "]", value: {
let value = RightBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: ":", value: {
let value = Colon({})
buffer -> {value: value, buffer: buffer}
}}, {key: ",", value: {
let value = Comma({})
buffer -> {value: value, buffer: buffer}
}}]
read_tokens -> acc -> buffer -> match {
Ok parts -> {
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> read_tokens(acc)(buffer)
False _ -> {
let switch = expect(std.keylist.find(switches)(grapheme))(IllegalCharachter(grapheme))
let value = switch(buffer)
let acc = [value.value, ..acc]
read_tokens(acc)(value.buffer)
}
}(is_whitespace(grapheme))
}
Error _ -> std.list.reverse(acc)
}(std.string.pop_grapheme(buffer))
})
let switches = [{key: """, value: {
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let read_string = TODO this shouldn't really be here({
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
read_string -> acc -> buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
})
let done = value -> buffer -> {value: value, buffer: buffer}
let acc = ""
buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
}}, {key: "t", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("r")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(True({}))(parts.tail)
}
}}, {key: "f", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("a")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("s")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(False({}))(parts.tail)
}
}}, {key: "n", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
done(Null({}))(parts.tail)
}
}}, {key: "{", value: {
let value = LeftBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "}", value: {
let value = RightBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "[", value: {
let value = LeftBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: "]", value: {
let value = RightBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: ":", value: {
let value = Colon({})
buffer -> {value: value, buffer: buffer}
}}, {key: ",", value: {
let value = Comma({})
buffer -> {value: value, buffer: buffer}
}}]
let acc = []
buffer -> match {
Ok parts -> {
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> read_tokens(acc)(buffer)
False _ -> {
let switch = expect(std.keylist.find(switches)(grapheme))(IllegalCharachter(grapheme))
let value = switch(buffer)
let acc = [value.value, ..acc]
read_tokens(acc)(value.buffer)
}
}(is_whitespace(grapheme))
}
Error _ -> std.list.reverse(acc)
}(std.string.pop_grapheme(buffer))
}
decoder -> input -> catch(_ -> decoder(read_tokens(input)).value)
}
let should = {equal: {
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
expected -> given -> match {
True _ -> {}
False _ -> {
let failure = NotEqual({given: given, expected: expected})
perform Fail(failure)
}
}(std.equal(expected)(given))
}, be: {
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
match -> match(value -> value)(other -> perform Abort(std.string.append("incorrect variant: ")(std.debug(other))))
}, to_string: match {
NotEqual {
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
fail -> std.string.concat(["expected: ", std.debug(fail.expected), " given: ", std.debug(fail.given)])
}
}}
let string = {
let abort = perform Abort
let next_token = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
tokens -> expect(std.list.pop(tokens))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
tokens -> {
let parts = next_token(tokens)
let token = parts.head
match {
String value -> done(value)(parts.tail)
_ -> abort(UnexpectedToken(token))
}(token)
}
}
let boolean = {
let abort = perform Abort
let next_token = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
tokens -> expect(std.list.pop(tokens))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
tokens -> {
let parts = next_token(tokens)
let token = parts.head
let tokens = parts.tail
match {
True _ -> done(True({}))(tokens)
False _ -> done(False({}))(tokens)
_ -> abort(UnexpectedToken(token))
}(token)
}
}
_ -> {
let parsed = should.be(match Ok)(parse(string)(""chars,.""))
let _ = should.equal("chars,.")(parsed)
let parsed = should.be(match Ok)(parse(list(string))("[]"))
let _ = should.equal([])(parsed)
let parsed = should.be(match Ok)(parse(list(string))("["a", "b", "c"]"))
let _ = should.equal(["a", "b", "c"])(parsed)
let parsed = should.be(match Ok)(parse(list(list(boolean)))("[[], [true, false]]"))
let _ = should.equal([[], [True({}), False({})]])(parsed)
{}
}
}, name: "parse"}, {exec: {
let object = {
let next_item = {
let next_item = TODO this shouldn't really be here({
let next_token = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
tokens -> expect(std.list.pop(tokens))(UnexpectedEndOfInput({}))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
let switches = [{key: LeftBracket({}), value: stack -> [LeftBracket({}), ..stack]}, {key: LeftBrace({}), value: stack -> [LeftBrace({}), ..stack]}, {key: RightBracket({}), value: {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let abort = perform Abort
stack -> {
let popped = expect(std.list.pop(stack))(UnexpectedTerminator({}))
match {
True _ -> popped.tail
False _ -> abort(UnexpectedTerminator({}))
}(std.equal(LeftBracket({}))(popped.head))
}
}}, {key: RightBrace({}), value: {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let abort = perform Abort
stack -> {
let popped = expect(std.list.pop(stack))(UnexpectedTerminator({}))
match {
True _ -> popped.tail
False _ -> abort(UnexpectedTerminator({}))
}(std.equal(LeftBrace({}))(popped.head))
}
}}]
next_item -> acc -> stack -> tokens -> {
let start = next_token(tokens)
let acc = [start.head, ..acc]
let stack = match {
Ok update -> update(stack)
Error _ -> stack
}(std.keylist.find(switches)(start.head))
match {
True _ -> done(std.list.reverse(acc))(start.tail)
False _ -> next_item(acc)(stack)(start.tail)
}(std.equal([])(stack))
}
})
let next_token = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
tokens -> expect(std.list.pop(tokens))(UnexpectedEndOfInput({}))
}
let stack = []
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
let switches = [{key: LeftBracket({}), value: stack -> [LeftBracket({}), ..stack]}, {key: LeftBrace({}), value: stack -> [LeftBrace({}), ..stack]}, {key: RightBracket({}), value: {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let abort = perform Abort
stack -> {
let popped = expect(std.list.pop(stack))(UnexpectedTerminator({}))
match {
True _ -> popped.tail
False _ -> abort(UnexpectedTerminator({}))
}(std.equal(LeftBracket({}))(popped.head))
}
}}, {key: RightBrace({}), value: {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let abort = perform Abort
stack -> {
let popped = expect(std.list.pop(stack))(UnexpectedTerminator({}))
match {
True _ -> popped.tail
False _ -> abort(UnexpectedTerminator({}))
}(std.equal(LeftBrace({}))(popped.head))
}
}}]
let acc = []
tokens -> {
let start = next_token(tokens)
let acc = [start.head, ..acc]
let stack = match {
Ok update -> update(stack)
Error _ -> stack
}(std.keylist.find(switches)(start.head))
match {
True _ -> done(std.list.reverse(acc))(start.tail)
False _ -> next_item(acc)(stack)(start.tail)
}(std.equal([])(stack))
}
}
let abort = perform Abort
let next_token = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
tokens -> expect(std.list.pop(tokens))(UnexpectedEndOfInput({}))
}
let is = match -> match(value -> value)(other -> perform Abort(UnexpectedToken(other)))
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
builder -> tokens -> {
let parts = next_token(tokens)
let _ = is(match LeftBrace)(parts.head)
let tokens = parts.tail
let parts = std.fix(read_field -> acc -> tokens -> {
let parts = next_token(tokens)
let token = parts.head
let tokens = parts.tail
match {
String key -> {
let parts = next_token(tokens)
let _ = is(match Colon)(parts.head)
let tokens = parts.tail
let consumed = next_item(parts.tail)
let acc = [{key: key, value: consumed.value}, ..acc]
let parts = next_token(consumed.buffer)
let token = parts.head
let tokens = parts.tail
match {
Comma _ -> read_field(acc)(tokens)
RightBrace _ -> done(acc)(tokens)
_ -> abort(UnexpectedToken(token))
}(parts.head)
}
RightBrace _ -> done(acc)(tokens)
_ -> abort(UnexpectedToken(token))
}(token)
})([])(tokens)
let fields = parts.value
let value = builder(fields)
done(value)(parts.buffer)
}
}
let end = t -> _fields -> t
let field = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
key -> decoder -> next -> build -> bag -> {
let parts = expect(std.keylist.pop(bag)(key))(MissingField(key))
let bag = parts.rest
let _ = "expected decoded to have nothing in buffer"
let decoded = decoder(parts.value)
let build = build(decoded.value)
next(build)(bag)
}
}
let parse = {
let catch = exec -> handle Abort(reason -> _kont -> Error(reason))(_ -> Ok(exec({})))
let read_tokens = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let is_whitespace = {
let list = [" "]
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let read_tokens = TODO this shouldn't really be here({
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let is_whitespace = {
let list = [" "]
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let switches = [{key: """, value: {
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let read_string = TODO this shouldn't really be here({
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
read_string -> acc -> buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
})
let done = value -> buffer -> {value: value, buffer: buffer}
let acc = ""
buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
}}, {key: "t", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("r")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(True({}))(parts.tail)
}
}}, {key: "f", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("a")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("s")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(False({}))(parts.tail)
}
}}, {key: "n", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
done(Null({}))(parts.tail)
}
}}, {key: "{", value: {
let value = LeftBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "}", value: {
let value = RightBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "[", value: {
let value = LeftBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: "]", value: {
let value = RightBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: ":", value: {
let value = Colon({})
buffer -> {value: value, buffer: buffer}
}}, {key: ",", value: {
let value = Comma({})
buffer -> {value: value, buffer: buffer}
}}]
read_tokens -> acc -> buffer -> match {
Ok parts -> {
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> read_tokens(acc)(buffer)
False _ -> {
let switch = expect(std.keylist.find(switches)(grapheme))(IllegalCharachter(grapheme))
let value = switch(buffer)
let acc = [value.value, ..acc]
read_tokens(acc)(value.buffer)
}
}(is_whitespace(grapheme))
}
Error _ -> std.list.reverse(acc)
}(std.string.pop_grapheme(buffer))
})
let switches = [{key: """, value: {
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let read_string = TODO this shouldn't really be here({
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
let done = value -> buffer -> {value: value, buffer: buffer}
read_string -> acc -> buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
})
let done = value -> buffer -> {value: value, buffer: buffer}
let acc = ""
buffer -> {
let parts = pop_grapheme(buffer)
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> done(String(acc))(buffer)
False _ -> {
let _ = "TODO escape strings"
let acc = std.string.append(acc)(grapheme)
read_string(acc)(buffer)
}
}(std.equal(""")(grapheme))
}
}}, {key: "t", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("r")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(True({}))(parts.tail)
}
}}, {key: "f", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("a")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("s")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("e")(parts.head)
done(False({}))(parts.tail)
}
}}, {key: "n", value: {
let ensure = {
let abort = perform Abort
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
want -> value -> match {
True _ -> {}
False _ -> abort(IllegalLiteral(value))
}(std.equal(want)(value))
}
let pop_grapheme = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
buffer -> expect(std.string.pop_grapheme(buffer))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
buffer -> {
let parts = pop_grapheme(buffer)
let _ = ensure("u")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
let parts = pop_grapheme(parts.tail)
let _ = ensure("l")(parts.head)
done(Null({}))(parts.tail)
}
}}, {key: "{", value: {
let value = LeftBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "}", value: {
let value = RightBrace({})
buffer -> {value: value, buffer: buffer}
}}, {key: "[", value: {
let value = LeftBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: "]", value: {
let value = RightBracket({})
buffer -> {value: value, buffer: buffer}
}}, {key: ":", value: {
let value = Colon({})
buffer -> {value: value, buffer: buffer}
}}, {key: ",", value: {
let value = Comma({})
buffer -> {value: value, buffer: buffer}
}}]
let acc = []
buffer -> match {
Ok parts -> {
let grapheme = parts.head
let buffer = parts.tail
match {
True _ -> read_tokens(acc)(buffer)
False _ -> {
let switch = expect(std.keylist.find(switches)(grapheme))(IllegalCharachter(grapheme))
let value = switch(buffer)
let acc = [value.value, ..acc]
read_tokens(acc)(value.buffer)
}
}(is_whitespace(grapheme))
}
Error _ -> std.list.reverse(acc)
}(std.string.pop_grapheme(buffer))
}
decoder -> input -> catch(_ -> decoder(read_tokens(input)).value)
}
let should = {equal: {
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
expected -> given -> match {
True _ -> {}
False _ -> {
let failure = NotEqual({given: given, expected: expected})
perform Fail(failure)
}
}(std.equal(expected)(given))
}, be: {
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
match -> match(value -> value)(other -> perform Abort(std.string.append("incorrect variant: ")(std.debug(other))))
}, to_string: match {
NotEqual {
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
fail -> std.string.concat(["expected: ", std.debug(fail.expected), " given: ", std.debug(fail.given)])
}
}}
let string = {
let abort = perform Abort
let next_token = {
let expect = {
let abort = perform Abort
result -> reason -> match {
Ok value -> value
Error _ -> abort(reason)
}(result)
}
let std = {equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, json: "TODO placeholder", boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
tokens -> expect(std.list.pop(tokens))(UnexpectedEndOfInput({}))
}
let done = value -> buffer -> {value: value, buffer: buffer}
tokens -> {
let parts = next_token(tokens)
let token = parts.head
match {
String value -> done(value)(parts.tail)
_ -> abort(UnexpectedToken(token))
}(token)
}
}
_ -> {
let decoder = object(field("x")(string)(field("y")(string)(end))(x -> y -> {x: x, y: y}))
let parsed = should.be(match Ok)(parse(decoder)("{"x":"a" ,"y": "b"}"))
let _ = should.equal({x: "a", y: "b"})(parsed)
let decoder = object(end({}))
let parsed = should.be(match Ok)(parse(decoder)("{"x":"a" ,"y": "b"}"))
let _ = should.equal({})(parsed)
let decoder = object(field("x")(object(end({})))(end)(x -> {x: x}))
let parsed = should.be(match Ok)(parse(decoder)("{"x":{} ,"y": "b"}"))
let _ = should.equal({x: {}})(parsed)
{}
}
}, name: "builder"}]}, equal: TODO this shouldn't really be here, debug: TODO this shouldn't really be here, eval: TODO this shouldn't really be here, fix: TODO this shouldn't really be here, capture: TODO this shouldn't really be here, serialize: TODO this shouldn't really be here, encode_uri: TODO this shouldn't really be here, logs: {log: term -> perform Log(term), capture: {
let handler = message -> k -> {
let inner = k({})
{logs: [message, ..inner.logs], ..inner}
}
run -> handle Log(handler)(_ -> {
let return = run({})
{return: return, logs: []}
})
}}, http: {get: h -> p -> {
let scheme = HTTPS({})
let port = None({})
let query = None({})
let headers = []
let body = ""
{method: Get({}), scheme: scheme, host: h, port: port, path: p, query: query, headers: headers, body: body}
}}, task: {async: exec -> perform Async(exec)}, boolean: {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}, result: {}, list: {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}, keylist: {find: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> {
let found = list.find(pair -> equal(key)(pair.key))(pairs)
match {
Ok pair -> Ok(pair.value)
Error reason -> Error(reason)
}(found)
}
}, pop: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let equal = TODO this shouldn't really be here
pairs -> key -> list.pop_map(pairs)(pair -> match {
True _ -> Ok(pair.value)
False _ -> Error({})
}(equal(pair.key)(key)))
}}, integer: {add: TODO this shouldn't really be here, subtract: TODO this shouldn't really be here, to_string: TODO this shouldn't really be here}, string: {uppercase: TODO this shouldn't really be here, lowercase: TODO this shouldn't really be here, append: TODO this shouldn't really be here, split: TODO this shouldn't really be here, replace: TODO this shouldn't really be here, pop_grapheme: TODO this shouldn't really be here, concat: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}, join: {
let list = {pop: TODO this shouldn't really be here, fold: TODO this shouldn't really be here, head: {
let pop = TODO this shouldn't really be here
l -> match {
Ok parts -> Ok(parts.head)
Error _ -> Error({})
}(pop(l))
}, find: {
let pop = TODO this shouldn't really be here
let self = TODO this shouldn't really be here({
let pop = TODO this shouldn't really be here
self -> predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
})
predicate -> list -> match {
Ok parts -> {
let item = parts.head
let matched = predicate(item)
match {
True _ -> Ok(item)
False _ -> self(predicate)(parts.tail)
}(matched)
}
Error Error
}(pop(list))
}, contains: {
let equal = TODO this shouldn't really be here
let boolean = {and: a -> b -> match {
True _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
False _ -> False({})
}(a), or: a -> b -> match {
True _ -> True({})
False _ -> match {
True _ -> True({})
False _ -> False({})
}(b)
}(a)}
let fold = TODO this shouldn't really be here
list -> item -> fold(list)(False({}))(el -> acc -> boolean.or(equal(item)(el))(acc))
}, reverse: {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}, append: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}, pop_map: {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
let pop_map = TODO this shouldn't really be here({
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let pop = TODO this shouldn't really be here
pop_map -> acc -> list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
})
let acc = []
list -> check -> match {
Ok parts -> {
let head = parts.head
match {
Ok value -> Ok({value: value, rest: move(acc)(parts.tail)})
Error _ -> pop_map([head, ..acc])(parts.tail)(check)
}(check(head))
}
Error _ -> Error({})
}(pop(list))
}, map: {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}, flatten: {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}, flat_map: {
let map = {
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> f -> {
let mapped = fold(list)([])(item -> acc -> [f(item), ..acc])
reverse(mapped)
}
}
let flatten = {
let append = {
let move = {
let fold = TODO this shouldn't really be here
first -> second -> fold(first)(second)(el -> acc -> [el, ..acc])
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
first -> second -> move(reverse(first))(second)
}
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
lists -> {
let reversed = reverse(lists)
fold(reversed)([])(append)
}
}
list -> f -> {
let mapped = map(list)(f)
flatten(mapped)
}
}, intersperse: {
let pop = TODO this shouldn't really be here
let reverse = {
let fold = TODO this shouldn't really be here
list -> fold(list)([])(el -> acc -> [el, ..acc])
}
let fold = TODO this shouldn't really be here
list -> element -> {
let reversed = reverse(list)
match {
Ok parts -> fold(parts.tail)([parts.head])(el -> acc -> [el, element, ..acc])
Error _ -> []
}(pop(reversed))
}
}}
let concat = {
let append = TODO this shouldn't really be here
l -> list.fold(l)("")(el -> acc -> append(acc)(el))
}
strings -> separator -> concat(list.intersperse(strings)(separator))
}}}
_ -> {
let std = std
let promise = perform HTTP(std.http.get("api.sunrise-sunset.org")("/json"))
let response = perform Await(promise)
let json = std.json
let results = json.object(json.field("sunrise")(json.string)(json.end)(s -> {sunrise: s}))
let decoder = json.object(json.field("results")(results)(json.end)(results -> results))
json.parse(decoder)(response)
}